package top.goldenyear.porpoise.framework.web.core.model.query;

import java.util.Arrays;
import java.util.Set;
import java.util.stream.Collectors;
import lombok.Getter;

/**
 * @author airhead
 */
@SuppressWarnings("AlibabaClassNamingShouldBeCamel")
@Getter
public enum QOperator {
  /** */
  EQ("="),
  GT(">"),
  GTE(">="),
  LT("<"),
  LE("<="),
  LIKE("like"),
  LIKE_LEFT("%like"),
  LIKE_RIGHT("like%"),
  IN("in"),
  BETWEEN("between"),
  ;
  private final String value;

  QOperator(String value) {
    this.value = value;
  }

  public static Set<String> valueSet() {
    return Arrays.stream(values()).map(QOperator::getValue).collect(Collectors.toSet());
  }
}
